{# builderInfo #}

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel='shortcut icon' href='{% if config.brand.favicon == "" %}{{ config.url }}/adios/assets/images/favicon.png{% else %}{{ config.brand.favicon }}{% endif %}'>
  <title>{{ config.brand.title }}</title>

  <script src="https://cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.11/lib/draggable.bundle.js"></script> {# TODO: Lepsia implementacia Draggable #}

  <script src='{{ config.url }}/adios/cache.js'></script>
  <script defer src='{{ config.url }}/src/Assets/Js/React/app.js'></script>
  <script>
    var _APP_UPLOAD_URL = '{{ config.uploadUrl }}';
  </script>

  <link rel=stylesheet type='text/css' href='{{ config.url }}/adios/cache.css' rel="stylesheet">
  {% if config.skin != '' %}
    <link rel=stylesheet type='text/css' href='{{ config.url }}/adios/assets/css/Skins/{{ config.skin }}.css' rel="stylesheet">
  {% endif %}

  <style>
    :root {
      --cl-main: #2d4a8a;
      --cl-trening: #ff9800;
      --cl-zapas: #ff9800;
      --cl-prenajom: #ff9800;
    }

    body #content-wrapper { display: none; }
    body.react-components-rendered #content-wrapper { display: block; }
  </style>
</head>

<body id="page-top">
  {% if viewParams.userNotifications|length > 0 %}
    <div id='adios_user_notifications'>
      {% for notification in viewParams.userNotifications %}
        <div class='alert alert-danger' role='alert' onclick='$(this).fadeOut(function() { $(this).remove(); })'>
          {{ notification|raw }}
        </div>
      {% endfor %}
    </div>
  {% endif %}

  <!-- Page Wrapper -->
  <div id="wrapper">

    <!-- Sidebar -->
    <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

      <!-- Sidebar - Brand -->
      <a
        class="sidebar-brand d-flex align-items-center justify-content-center"
        href="{{ config.url }}/{{ config.brand.sidebar.iconUrl }}"
      >
        {% if config.brand.sidebar.icon != "" %}
          <div class="sidebar-brand-icon">
            <img src="{{ config.brand.sidebar.icon }}" />
          </div>
        {% endif %}
        {% if config.brand.sidebar.title != "" %}
          <div class="sidebar-brand-text ml-3">
            {{ config.brand.sidebar.title|raw }}
            <div class="sidebar-brand-text-sub">{{ config.brand.sidebar.subtitle|raw }}</div>
          </div>
        {% endif %}
      </a>

      {% for shortcut in config.desktop.sidebarItems %}
        {% if shortcut.separator %}
          <hr class="sidebar-divider d-none d-md-block">
        {% else %}
          <li class="nav-item" style="{{ shortcut.cssStyle }}">
            <a
              id="nav-link-{{ loop.index }}"
              {% if shortcut.sub is iterable %}
                class="nav-link collapsed"
                href="javascript:void(0)"
                data-toggle="collapse"
                data-target="#collapse{{ loop.index }}"
                aria-expanded="true"
                aria-controls="collapse{{ loop.index }}"
              {% else %}
                class="nav-link"
                href="{% if shortcut.href == '' %}javascript:void(0){% else %}{{ shortcut.href }}{% endif %}"
                onclick="
                  if (typeof Cookies == 'object') {
                    Cookies.set('sidebarActiveMainItem', '{{ loop.index }}', 1);
                    Cookies.set('sidebarActiveSubItem', '0', 1);
                  }
                  {{ shortcut.onclick|raw }}
                "
              {% endif %}
            >
              
              {% if shortcut.icon %}<i class="{{ shortcut.icon }}"></i>{% endif %}
              <span>{{ shortcut.title|raw }}</span>
            </a>
            {% if shortcut.sub is iterable %}
              <div
                id="collapse{{ loop.index }}"
                class="collapse {% if _COOKIE.sidebarActiveMainItem == loop.index %} show {% endif %}"
                aria-labelledby="heading{{ loop.index }}"
                data-parent="#accordionSidebar"
              >
                <div class="collapse-inner">
                  {% for sub in shortcut.sub %}
                    <a
                      class="collapse-item dropdown collapsed {% if _COOKIE.sidebarActiveMainItem == loop.parent.loop.index and _COOKIE.sidebarActiveSubItem == loop.index %} active {% endif %}"
                       style="{{ sub.style }}"
                      onclick="Cookies.set('sidebarActiveSubItem', '{{ loop.index }}', 1); {{ sub.onclick|raw }}"
                      role="button"
                      href="#sidebarSubSub{{ loop.parent.loop.index }}-{{ loop.index }}"
                      data-toggle="collapse" aria-expanded="false"
                    >
                      {{ translate(sub.title, shortcut.___widgetClassName) }}
                    </a>
                    {% if sub.sub is iterable %}
                      <div
                        class="sidebar-sub-sub {% if _COOKIE.sidebarActiveMainItem == loop.parent.loop.index and _COOKIE.sidebarActiveSubItem == loop.index %} {% else %} collapse {% endif %}"
                        id="sidebarSubSub{{ loop.parent.loop.index }}-{{ loop.index }}"
                      >
                        {% for subsub in sub.sub %}
                          <a
                            class="nav-item"
                            style="display:block;margin-bottom:0.1rem;margin-top:0.1rem;"
                            href="javascript:void(0)"
                            onclick="{{ subsub.onclick|raw }}"
                          >{{ subsub.title }}</a>
                        {% endfor %}
                      </div>
                    {% endif %}
                  {% endfor %}
                </div>
              </div>
            {% endif %}
          </li>
        {% endif %}
      {% endfor %}

      <hr class="sidebar-divider d-none d-md-block">

      <!-- Sidebar Toggler (Sidebar) -->
      <!-- <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
      </div> -->

    </ul>
    <!-- End of Sidebar -->

    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

      <!-- Main Content -->
      <div id="content">

        <!-- Topbar -->
        <nav class="navbar navbar-expand navbar-light bg-white topbar static-top row shadow">
          <div class="col col-10">
            {% if config.top_bar.custom.controller != "" %}
              {{ adiosRender(config.top_bar.custom.controller, config.top_bar.custom.controller_params)|raw }}
            {% else %}
              {{ config.brand.title }} &raquo; {{ config.brand.headline }}
            {% endif %}
          </div>

          {% if searchButton.display %}
            <div class="col col-12 col-md-4">
              <form
                class='d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search'
                method='GET'
              >
                <div class='input-group'>
                  <input
                    type='text'
                    name='search'
                    class='form-control bg-light border-0 small'
                    value='{{ _REQUEST.search }}'
                    placeholder='{{ searchButton.placeholder }}'
                    aria-label='Search'
                  />
                  <div class='input-group-append'>
                    <button class='btn btn-primary' type='button' onclick='$(this).closest("form").submit();'>
                      <i class='fas fa-search fa-sm'></i>
                    </button>
                  </div>
                </div>
              </form>
            </div>
          {% endif %}

          <!-- Topbar Navbar -->
          <div class="col col-2">
            <ul class="navbar-nav flex-row-reverse">
              <!-- Nav Item - User Information -->
              {% if user.id > 0 %}
                <li class="nav-item dropdown no-arrow">
                  <a class="nav-link dropdown-toggle " href="javascript:void(0)" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <span class="mr-2 d-none d-lg-inline text-gray-600 small">{{ user.name }} {{ user.surname }}</span>
                    <i class='btn btn-primary btn-sm btn-circle fas fa-user-tie' style='font-weight:900'></i>
                  </a>
                  <!-- Dropdown - User Information -->
                  <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown">
                    {% for item in viewParams.topRightMenu.items %}
                      <a class="dropdown-item" href="javascript:void(0)" onclick="{{ item.onclick|raw }}">
                        <i class="{{ item.faIcon }} fa-sm fa-fw mr-2 text-gray-400"></i>
                        {{ item.text }}
                      </a>
                    {% endfor %}
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="{{ config.url }}/?sign-out">
                      <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                      {{ translate("Sign out") }}
                    </a>
                  </div>
                </li>
              {% endif %}

              <!-- Language selection -->
              {% if config.availableLanguages|length > 1 %}
                <li class="nav-item dropdown no-arrow">
                  <a class="nav-link dropdown-toggle " href="javascript:void(0)" id="languageDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <span class="mr-2 d-none d-lg-inline text-gray-600 small">{{ config.language|upper }}</span>
                    <i class='btn btn-light btn-sm fas fa-language'></i>
                  </a>
                  <div class="dropdown-menu shadow animated--grow-in" aria-labelledby="languageDropdown">
                    {% for lang in config.availableLanguages %}
                      <a
                        href="javascript:void(0);"
                        onclick="
                          _ajax_read('Desktop/Ajax/SetLanguage', {'language': '{{ lang }}'}, function(res) {
                            location.reload()
                          });
                        ";
                        class="dropdown-item {% if lang == config.language %} active {% endif %}"
                      >
                        <i class="{{ item.fa_icon }} fa-sm fa-fw mr-2 text-gray-400"></i>
                        {{ lang|upper }}
                      </a>
                    {% endfor %}
                  </div>
                </li>
              {% endif %}

              <li class="nav-item dropdown no-arrow">
                <div class="nav-link">
                  {{ user.login }}
                </div>
              </li>

            </ul>
          </div>

        </nav>
        <!-- End of Topbar -->

        <!-- Begin Page Content -->
        <div class="adios main-content">
          <div class="windows">
            <div class="windows-content"></div>
          </div>
          <div class="p-3">
            {{ contentHtml|raw }}
          </div>
        </div>
        <!-- /.container-fluid -->

      </div>
      <!-- End of Main Content -->

    </div>
    <!-- End of Content Wrapper -->

  </div>
  <!-- End of Page Wrapper -->

  <adios-modal
    uid="global"
    title=" "
  ></adios-modal>

</body>

</html>
